package com.qying.rpc.serialzation;


import lombok.Getter;

public enum SerialzationTypeEnum {

    HESSIAN(0x10),
    JSON(0x20);

    @Getter
    private final int type;

    SerialzationTypeEnum(int type){
        this.type = type;
    }

    public static SerialzationTypeEnum findByType(byte serialzationType) {
        for (SerialzationTypeEnum value : SerialzationTypeEnum.values()) {
            if (value.getType() == serialzationType) {
                return value;
            }
        }
        return HESSIAN;
    }

}
